<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件
//生成随机验证码
function num6_rand(){
	$num=floor(mt_rand(100000000,999999999)/1000);
	return $num;
}
//获取当前月范围时间戳
function get_mouth_time(){
	$thismonth = date('m');
	$thisyear = date('Y');
	$startDay = $thisyear . '-' . $thismonth . '-1';
	$endDay = $thisyear . '-' . $thismonth . '-' . date('t', strtotime($startDay));
	$b_time  = strtotime($startDay);
	$e_time  = strtotime($endDay);
	return array($b_time,$e_time);
}
//自动生成订单号
function rand_order_num(){
    return 'TD'.date('Ymd').substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8);
}
